package com.tang.algorithm.dynamicProgramming;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/8/9 22:20
 */
public class LeetCode70 {
    public int climbStairs(int n) {
        int p = 0, q = 0, r = 1;
        for (int i = 1; i <= n; ++i) {
            p = q;
            q = r;
            r = p + q;
        }
        return r;

    }
}
